import axios from '@/libs/api.request'
import {getFullUrl} from '../config'

let getUrl = getFullUrl('user')

//--------------------------------------GET
// 获取所有项目类型
export const listBanner = () => {
  return axios.request({
    url: getUrl('/banner'),
    method: 'GET'
  })
}

// 获取所有项目类型
export const listProjects = () => {
  return axios.request({
    url: getUrl('/projects'),
    method: 'GET'
  })
}


//--------------------------------------POST

// 添加项目类型
export const addBanner = (banner) => {
  return axios.request({
    url: getUrl('/banner'),
    method: 'POST',
    data: banner
  })
}


//--------------------------------------PATCH

// 更新项目类型
export const updateBanner = (banner) => {
  return axios.request({
    url: getUrl('/banner'),
    method: 'PUT',
    data: banner
  })
}

//--------------------------------------DELETE

// 删除项目类型
export const removeBanner = (bannerId) => {
  return axios.request({
    url: getUrl('/banner/' + bannerId),
    method: 'DELETE'
  })
}
